package cn.wolfcode.luowowo.service.impl;

import cn.wolfcode.luowowo.domain.Person;
import cn.wolfcode.luowowo.domain.UserInfo;
import cn.wolfcode.luowowo.exception.LogicException;
import cn.wolfcode.luowowo.redis.RedisService.IUserInfoRedisService;
import cn.wolfcode.luowowo.repository.PersonRepository;
import cn.wolfcode.luowowo.repository.UserInfoRepository;
import cn.wolfcode.luowowo.service.IPersonService;
import cn.wolfcode.luowowo.service.IUserInfoService;
import cn.wolfcode.luowowo.util.AssertUtil;
import cn.wolfcode.luowowo.util.Consts;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.time.Period;
import java.util.List;
import java.util.Optional;
import java.util.UUID;

@Service
//@Transactional
public class PersonServiceImpl implements IPersonService {

    @Autowired
    private PersonRepository personRepository;

    @Override
    public List<Person> list() {
        return personRepository.findAll();
    }

    @Override
    public void save() {
        Person person = new Person();
        person.setNickname("dafei");
        person.setHeadImgUrl("/images/default.jpg");
        personRepository.save(person);
    }
}
